﻿@using Project_KhuyenMaiVang.Models
@model Project_KhuyenMaiVang.Models.IndexModel
<!DOCTYPE html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    @{
        var theme = "Theme" + Session["Theme"];        
    }
    <link href="@Url.Content("~/App_Themes/" + @theme + "/StyleSheet.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="../../Scripts/jquery.unobtrusive-ajax.js" type="text/javascript"></script>
</head>
@{
    var MaKhuVuc = Session["MaKhuVuc"];
    List<Project_KhuyenMaiVang.Models.KhuVucDTO> ListKhuVuc = ViewBag.DsKhuVuc;
    var ItemsKhuVu = new SelectList(ListKhuVuc, "MaKhuVuc", "TenKhuVuc", MaKhuVuc);
      
}
<style type="text/css">
    input#EmailDangKy
    {
        width: 97%;
    }
</style>
<body>
    <div id="banner">
        <div id="contentbanner">
            <div id="theme">
                @using (Html.BeginForm("Index", "Home"))
                {
                    <label>
                        <input type="submit" style="background: aqua" name="ThemeReplace" value=" " onclick="this.value=1" src="@Url.Content("~/Content/Images/color01.jpg") "/>
                        <input type="submit" style="background: blueviolet" name="ThemeReplace" value=" " onclick="this.value=2" src="@Url.Content("~/Content/Images/color02.jpg")"/>
                        <input type="submit" style="background: brown" name="ThemeReplace" value=" " onclick="this.value=3" src="@Url.Content("~/Content/Images/color03.jpg")"/>
                    </label>
                }
            </div>
            <div id="logo">@Html.ActionLink(" ", "Index", "Home")</div>
            <div id="DynamicContent">
                @using (Html.BeginForm("Index", "Home"))
                {               
                    <table width="100%" border="0">
                        <tr>
                            <td width="32%" height="26">
                                <span style="color: white">Chọn thành phố:</span>
                            </td>
                            <td align="left" colspan="2">
                                <span style="color: white">Đăng ký nhận tin khuyến mãi:</span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                @Html.DropDownListFor(model => model.MaThanhPho, ItemsKhuVu, new { onchange = "this.form.submit();" })
                            </td>
                            <td width="43%">@Html.EditorFor(model => model.EmailDangKy)
                            </td>
                            <td width="25%">
                                <form id="form3" name="form3" method="post" action="">
                                <label>
                                    <input type="image" src="@Url.Content("~/Content/Images/buttondangkypng.png")"/>
                                </label>
                                </form>
                            </td>
                        </tr>
                    </table>
                }
            </div>
        </div>
    </div>
    <div id="menu">
        <div id="contentmenu">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td width="75%">
                        <ul style="width: 700px">
                            <li>@Html.ActionLink("Deal hôm nay", "Index", "Home")</li>
                            <div align="right">
                            </div>
                            <li>@Html.ActionLink("Deal gần đây", "Index", "Home")</li>
                            <li>
                                @if (ViewBag.Role != null)
                                {
                                    int maNguoiDung = (int)ViewBag.Role;
                                    switch (maNguoiDung)
                                    {
                                        case 1:
                                            {
                                               @Html.ActionLink("Chức năng admin", "Index", "Admin")
                                               break;
                                            }

                                        case 2:
                                            {
                                               @Html.ActionLink("Chức năng Member", "Index", "Member")
                                               break;
                                            }

                                        case 3:
                                            {
                                                @Html.ActionLink("Chức năng doanh nghiệp", "Index", "DoanhNghiep");
                                                break;
                                            }
                                            
                                    }
                                }
                            </li>
                        </ul>
                    </td>
                    <td width="25%">
                        <div align="right">
                            @if (!User.Identity.Name.IsEmpty() && User.Identity.Name != null)
                            {
                                if (ViewBag.Role == 2)
                                {
                                <a href =@Url.Action("Index", "Member")>
                                    <img src="../../Content/Images/avatar_admin.png" /></a>                                
                                }
                                else if (ViewBag.Role == 3)
                                {
                                <a href =@Url.Action("Index", "DoanhNghiep")>
                                    <img src="../../Content/Images/avatar_admin.png" /></a>   
                                }
                                else if (ViewBag.Role == 1)
                                {
                                <img src="../../Content/Images/avatar_admin.png" />
                                }
                                <span style="color: sandybrown">Hello!, @User.Identity.Name</span>
                                @Html.ActionLink("Đăng xuất", "DangXuat", "Account")
                            }
                            else
                            { 
                                @Html.ActionLink("Đăng ký", "DangKy", "Account") @:| @Html.ActionLink("Đăng nhập", "DangNhap", "Account")
                                                                                                                                                                                                                                                                                                    }
                        </div>
                    </td>
                </tr>
            </table>
        </div>
        <p>
            &nbsp;</p>
    </div>
    @if (ViewBag.FormToggle == "dang ky thanh cong")
    {
        <div id="FormToogle" align="center">
            <p style="color: coral; font-weight: bold; font-size: 20px">
                Đăng ký thành công!</p>
        </div>
    }
    else
    {
        if (ViewBag.FormToggle != null)
        {
        <div id="FormToogle" align="center">
            <p style="color: coral; font-weight: bold; font-size: 20px">
                @ViewBag.FormToggle
            </p>
        </div>
        }

    }
    <div id="part_Content">
        @RenderBody()
        <div class="clearboth">
        </div>
    </div>
    <div id="part_Footer">
        <div id="contact_info">
            <p align="center">
                Copyright&copy;GroupE2<br />
                Developers & Designers: 0912089 - 0912092 - 0912093 - 0912096 - 0912100<br />
            </p>
        </div>
    </div>
</body>
</html>
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $("#FormToogle").hide(4000);
    });


</script>
